<%
    Users user = Trader.getUser(request.getParameter("uid"));
	wstrader.task.quality.SampleApproval task = user.quality.sampleapproval;

	task.getRequest().setRequest(request);
	task.getResponse().setResponse(response,out);
	
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}
	((Tasks)task.getOwner()).clearFocus();
	task.setFocus(true);	
	Trader.window_width = "90%";	
	String QualityType = "A";
%>
<style type="text/css">
<!--
.style3 {font-family: Arial}
.style6 {font-size: 12px}
.style7 {
	font-family: Arial;
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
<%@include file="../header.jsp"%>
<script language="javascript">
function clickCardView()
{
	var form = document.formMain;
	form.action = "quality.sampleinput.card-view.jsp";
	form.submit();	
}
function cardViewClick(row)
{
	var form = document.formMain;
	form.sample_details.value = row.id;
	dblClick(row);
}
function doFilter()
{
	var form = document.formMain;
	form.action = "quality.sampleapproval.jsp";
	form.submit();
}
</script>
<form method="POST" name="formMain" action="" onSubmit="return dosearch()">				  
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <th colspan="4" align="left" scope="col"><img src="images/sampleapproval.jpg" width="300" height="30"></th>
      <th colspan="4" scope="col"><input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">
        <input type="hidden" name="task_id"    id = "task_id"   value="0">
        <input name="type" type="hidden" id="type"> <input name="sample_details" type="hidden" id="sample_details">
        <input name="category" type="hidden" id="category" value="1"></th>
    </tr>
    <tr align="left">
      <td colspan="8">
	    <table>
    <tr>
      <td width="150" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Sent/Received Date</span></strong></td>
      <td width="150" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Sent To / Received From </span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Sample Type </span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Origin</span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Grade</span></strong></td>
      <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Status</span></strong></td>
    </tr>
    <tr>
      <td height="32"><select name="sent_received_date" size="9" id="sent_received_date" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
        <%@include file="include/SampleSentRecdDateList.jsp"%>
      </select></td>
      <td>
	  <select name="buyer_seller_id" size="9" id="buyer_seller_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>
		  <%@include file="include/SampleBuyerSellerList.jsp"%>
      </select>
	  </td>
      <td><select name="sample_type" size="9" id="sample_type" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:160px;border:0">
        <option value="0" selected>All</option>
        <option value="S" >Sent</option>
        <option value="R" >Received</option>
        <%task.getResponse().setSelected("sample_type");%>
      </select></td>
      <td>
	  <select name="origin_id" size="9" id="origin_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>
	  	<%
			task.getResponse().setOption("origin_master","name");
			task.getResponse().setSelected("origin_id");
		%>	  

      </select>
	  </td>
      <td><select name="grade_id" size="9" id="grade_id" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  <option value="0" selected>All</option>
	  	<%
			task.getResponse().setOption("grade_master","name");
			task.getResponse().setSelected("grade_id");
		%>	  
      </select></td>
      <td>
	  <select name="status" size="9" id="status" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		<%//@include file="include/ContractLsDateList.jsp"%>
      </select>
	  </td>
    </tr>
	  
	  </table>      </td>
    </tr>
    <tr valign="top">
      <td colspan="8">	  <table width="100%"  border="1" cellspacing="1" cellpadding="1">
        <tr bordercolor="#EEEEEE">
          <td width="3%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Id</span></strong></td>
          <td width="9%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">QR.AP.No. </span></strong><strong><span class="style29 style3 style6"></span></strong></td>
          <td width="8%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Buyer / Seller </span></strong></td>
          <td width="7%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Location</span></strong></td>
          <td width="6%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Origin</span></strong></td>
          <td width="6%" rowspan="2" align="center" bgcolor="#EEEEEE" class="style7">Quality</td>
          <td width="15%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Grade</span></strong></td>
          <td width="4%" rowspan="2" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">App / Rej</span></strong><strong><span class="style29 style3 style6"></span></strong></td>
          <td colspan="4" align="center" bgcolor="#EEEEEE" class="style7">Defects</td>
          <td colspan="10" align="center" bgcolor="#EEEEEE" class="style7">Screen</td>
          </tr>
        <tr bordercolor="#EEEEEE">
          <td width="3%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">&nbsp;</span></strong><strong><span class="style29 style3 style6">Blk</span></strong></td>
          <td width="3%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Brw</span></strong><strong><span class="style29 style3 style6">&nbsp;</span></strong></td>
          <td width="3%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Brk</span></strong></td>
          <td width="3%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">FM</span></strong></td>
          <td width="3%" align="center" bgcolor="#EEEEEE"><span class="style7">+20</span></td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">19</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">18</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">17</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">16</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">15</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">14</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">13</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">12</td>
          <td width="3%" align="center" bgcolor="#EEEEEE" class="style7">-12</td>
        </tr>
        <tr>
          <td colspan="22">
            <div id=scroll1 style="BORDER:0px ; OVERFLOW: auto; WIDTH: 100%; HEIGHT: 260px;">
              <%@include file="quality.sampleapproval.list.details.jsp"%>
          </div></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="right">&nbsp;&nbsp;</td>
      <td align="right">&nbsp;</td>
      <td align="right">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="right" valign="middle">&nbsp;&nbsp;</td>
      <td align="right" valign="middle">&nbsp;</td>
      <td align="right" valign="middle">&nbsp;</td>
      <td align="right" valign="middle"><img src="images/cardview.jpg" width="55" height="18" onClick="clickCardView();"></td>
    </tr>
  </table>
</form>


<%@include file="../footer.jsp"%>

